package TreeDayShuZu.Exercise;

public class Exercise09 {
    public static void main(String[] args) {
        //声明两个数组
        // - 声明一个int类型的数组front，长度为35，默认值都是0；
        //- 声明一个int类型的数组after，长度为12，默认值都是0；
        int [] front=new int[35];
        int [] after=new int[12];
        //35选5
        for (int i = 1; i <=5; i++) {
            int index;
            do {
                index=(int) (Math.random()* front.length);
            }while (front[index]==1);
            front[index]=1;
        }
        //12选2
        for (int i = 1; i <=2 ; i++) {
            int index;
            do {
                index=(int) (Math.random()* after.length);
            }while (after[index]==1);
            after[index]=1;
        }
        System.out.println("本期大乐透的号码");
        System.out.println("前期号码为：");
        for (int i = 0; i < front.length; i++) {
            if (front[i]==1){
                System.out.print(i+1+"\t");
            }
        }
        System.out.println("\n后区号码为:");
        for (int i = 0; i < after.length; i++) {
            if (after[i]==1){
                System.out.print(i+1+"\t");
            }
        }
        System.out.println();
    }
}
